package edu.pku.sei.modeler.model.structure;

import org.w3c.dom.Element;

import edu.pku.sei.modeler.model.xml.XMLUtility;

/**
 * 
 * @author CrystalZhang
 *
 */
public class MetaLinkWithAngleAnchor extends MetaLink {

	protected double sourceAngle;
	
	protected double targetAngle;
	
	public double getSourceAngle() {
		return sourceAngle;
	}

	public void setSourceAngle(double sourceAngle) {
		this.sourceAngle = sourceAngle;
	}

	public double getTargetAngle() {
		return targetAngle;
	}

	public void setTargetAngle(double targetAngle) {
		this.targetAngle = targetAngle;
	}

	public void serialize(Element root) {
		super.serialize(root);
		//TODO XXX FIXME need to serialization
		XMLUtility.xmlInstance.serializeNodes(root, StructurePackage.LINK_BENDPOINTS, bendPoints);
		XMLUtility.xmlInstance.serializeNodeNotContain(root, StructurePackage.LINK_SOURCE, source);
		XMLUtility.xmlInstance.serializeNodeNotContain(root, StructurePackage.LINK_TARGET, target);
	}
	
	public void deSerialize(Element root) {
		super.deSerialize(root);
//		TODO XXX FIXME need to serialization
		this.getBendPoints().addAll(XMLUtility.xmlInstance.deSerializeNodes(root, StructurePackage.LINK_BENDPOINTS));
		source = (MetaNode)XMLUtility.xmlInstance.deSerializeNodeNotContain(root, StructurePackage.LINK_SOURCE,this);
		target = (MetaNode)XMLUtility.xmlInstance.deSerializeNodeNotContain(root, StructurePackage.LINK_TARGET,this);
	}
	
	
}
